<template>
	<view>
		<view class="invite-my" v-if="List.length > 0">
			<view class="top flex">
				<image src="../../static/invite/my-top.png" mode="widthFix"></image>
			</view>
			<view class="content">
				<view class="list">
					<view class="item" v-for="(item,index) in List" :key="index">
						<view class="item-header flex">
							<view class="left">
								<view class="img">
									<u--image src="https://program.qdlearn.cn/ma/images/hy.jpg" width="160" height="160" shape="circle"></u--image>
								</view>
								<view class="title">
									{{item.username}}
								</view>
							</view>
							<view class="center">
								<view class="icon flex">
									<u-icon name="arrow-rightward" size="40" color="#fff"></u-icon>
								</view>
								<view class="title">
									我邀约
								</view>
							</view>
							<view class="left">
								<view class="img">
									<u--image src="https://program.qdlearn.cn/ma/images/hy.jpg" width="160" height="160" shape="circle"></u--image>
								</view>
								<view class="title">
									{{item.to_user}}
								</view>
							</view>
						</view>
						<view class="item-main">
							<view class="li flex">
								<image src="../../static/invite/my1.png" mode=""></image>
								<text>报读院校：{{item.school}}</text>
							</view>
							<view class="li flex">
								<image src="../../static/invite/my2.png" mode=""></image>
								<text>报读专业：{{item.major}}</text>
							</view>
							<view class="li flex">
								<image src="../../static/invite/my3.png" mode=""></image>
								<text>报名时间：{{item.createtime}}</text>
							</view>
						</view>
						
						<view class="item-footer flex">
							<text>获得邀约奖金</text>
							<text class="num">+{{item.share_points}}</text>
						</view>
						
						<view class="item-succ">
							<image src="../../static/invite/succ.png" mode="widthFix"></image>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view v-if="List.length == 0" class="cm-none-tips">
			<image src="../../static/images/none_tip.png" mode="aspectFit"></image>
			<view>暂无邀约见证~</view>
		</view>
	</view>
</template>

<script>
	import Util from '@/utils/util';
	import Alert from '@/utils/alert';
	import Api from '@/utils/api';
	import Rest from '@/utils/rest';
	
	import {
		mapState,
		mapGetters,
		mapMutations
	} from 'vuex'
	import store from '@/store/index.js'
	export default {
		data() {
			return {
				List:[]
			};
		},
		onShow() {
			this.invite()
			
			
		},
		methods: {
			invite(){
				Rest.post(Api.ZHUIGE_Index_InviteProve, {
					'type':this.tabLindex
				}).then(res => {
					if(res.code==0){
						this.List = res.data?res.data.invite_reward:[];
					}else{
						this.$u.toast(res.msg);
					}
					
				}, err => {
					console.log(err)
				});
			},
		}
	}
</script>

<style lang="scss">
	/* -------- 提示 -------- */
	.cm-none-tips {
		text-align: center;
		padding: 100rpx;
	}
	.cm-none-tips image {
		height: 200rpx;
		width: 200rpx;
		margin-bottom: 30rpx;
	}
	.cm-none-tips view {
		font-size: 24rpx;
		font-weight: 300;
		color: #999999;
	}
	
	page {
		height: 100vh;
		width: 100vw;
	}
	.invite {
		&-my {
			min-height: 100%;
			background-color: red;
			background: url(https://img.367edu.com/200742/0/3b75ff53-b69a-4b80-9573-6b4a00c871af/original) no-repeat ;
			background-size: 100% 100%;
			.top {
				padding: 100rpx 120rpx;
				align-items: center;
				justify-content: center;
			}
			.content {
				.list {
					padding: 32rpx;
					.item {
						background-color: #fff;
						position: relative;
						padding: 52rpx;
						margin-bottom: 30rpx;
						&-header {
							align-items: center;
							justify-content: space-between;
							.left {
								text-align: center;
								.img {
									border: 4rpx solid #BDBDBD;
									border-radius: 50%;
								}
								.title {
									padding: 10rpx 0;
									font-size: 32rpx;
								}
							}
							.center {
								text-align: center;
								.icon {
									width: 60rpx;
									height: 60rpx;
									border-radius: 50%;
									background-color: #3EB734;
									align-items: center;
									justify-content: center;
									margin: 0 auto;
								}
								.title {
									font-size: 24rpx;
									padding-top: 10rpx;
								}
							}
						}
						&-main {
							color: #999;
							font-size: 26rpx;
							margin-top: 40rpx;
							padding-bottom: 30rpx;
							.li {
								margin-bottom: 10rpx;
								align-items: center;
								image{
									width: 26rpx;
									height: 26rpx;
									padding-right: 10rpx;
									
								}
							}
							border-bottom: 2rpx solid #eee;
						}
						
						&-footer {
							padding: 32rpx 0; 
							align-items: center;
							justify-content: space-between;
							.num {
								color: #3EB734;
								font-size: 42rpx;
								font-weight: 700;
							}
						}
						
						&-succ {
							width: 180rpx;
							height: 180rpx;
							position: absolute;
							left: 50%;
							top: 50%;
							transform: translate(-50%,-50%);
							z-index: 2;
						}
						
					}
					.item::before {
					    content: ' ';
						width: 0;
						/* height: 100%; */
						height: 0;
						width: 100%;
						position: absolute;
						border-bottom: 16rpx dotted #FA5355;
						top: -10rpx;
						left: 0px;
					}
					
					.item::after {
					    content: ' ';
						height: 0;
						width: 100%;
						position: absolute;
						border-bottom: 16rpx dotted #FA5355;
						bottom: -10rpx;
						left: 0px; 
					
					}
				}
			}
		}
	}
</style>
